home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / trace1a.arc / TRACE1E.AIC < prev   
Encoding:
Text File  |  1987-02-04  |  7.6 KB  |  233 lines

  1. ;*******************************************************
  2. ;    B E G I N     C O N F I G U R A T I O N
  3. ;
  4. ;    TRACE1E.AIC built by Arny Krueger 02/22/86
  5. ;
  6. ;*******************************************************
  7.  
  8. ;
  9. ;  Some general equates for civilized coding
  10. ;
  11.  
  12.  
  13. cr             equ     13
  14. lf             equ     10
  15.  
  16. ;********************************************************
  17. ;
  18. ; Equates used for general configuration
  19. ;
  20. ;********************************************************
  21.  
  22. ;
  23. ; Set trace_size to number of K bytes to set aside for trace table.
  24. ;
  25.  
  26. trace_size      equ     30
  27.  
  28. ;
  29. ; Set iamhere to be a flag that indicates we are already in place.
  30. ; The first byte is interpreted as a DOS function number (AH) for INT 21h
  31. ;
  32.  
  33. iamhere         equ     0E0E0h
  34.  
  35. ;
  36. ; Set peri_int to the interrupt number (usually 060H) to be used
  37. ; by Periscope to invoke our reporting routines.
  38. ;
  39.  
  40. peri_int        equ     060h
  41.  
  42. ;
  43. ; Set prt_scr non-zero to assemble code that allows control via SHIFT-PrtSc.
  44. ;
  45.  
  46. prt_scr         equ     1
  47.  
  48. ;
  49. ; Set use_prt non-zero to start up using the printer instead of the screen
  50. ;
  51.  
  52. use_prt         equ     0
  53.  
  54. ;
  55. ; Set num_feeds to number of extra Linefeeds to send to printer to jack
  56. ; up the paper enough to let you read it, after display of menus etc.
  57. ; Note! in TRACE2E.AIC
  58.  
  59. Num_feeds       equ     5       ;Number of line feeds on printer after prompt
  60.  
  61. ;********************************************************
  62. ;
  63. ; Equates used for printing and formatting
  64. ;
  65. ;********************************************************
  66.  
  67. Edit_End        equ     0f0h    ;End of input line
  68. Edit_Byte       equ     0f1h    ;Next byte is 8-bit value to be printed in hex
  69. Edit_Word       equ     0f2h    ;Next 2 bytes are 16-bit value to be printed in hex
  70. Edit_Line       equ     0f3h    ;Next 2 bytes are address of string for print_line()
  71. Edit_Call       equ     0f4h    ;Next byte is AH arg, next 2 are DX arg,
  72.                                 ;and next 2 are subroutine address to call
  73. Edit_Dec8       equ     0f5h    ;Next byte is 8-bit value to be printed as decimal
  74. Edit_Dec16      equ     0f6h    ;Next 2 bytes are 16-bit value to be printed as decimal
  75. Edit_Skip       equ     0f7h    ;Ignore this byte (don't display it)
  76.  
  77.  
  78. ;********************************************************
  79. ;
  80. ; Map of Before and After entries in the trace table
  81. ;
  82. ;********************************************************
  83.  
  84. ;
  85. ; Trace entry byte zero (the type byte) identifies entry as follows:
  86. ;   Bits 7-4 = trace type
  87. ;
  88. ;               0000 = BEFORE int was executed
  89. ;               0001 = AFTER int was executed
  90. ;               0010 = FCB referenced by an INT 21h
  91. ;               0011 = ASCIIZ referenced by an INT 21h
  92. ;
  93. ;   Bit 3    = RESERVED
  94. ;
  95. ;   Bits 2-0 = ICT # (0-7) which made this trace record
  96. ;
  97. ; Record formats are as follows:
  98. ;
  99.  
  100. BEFORE          struc           ;BEFORE trace entry
  101. B_type          db      ?       ;see above
  102. B_int           db      ?       ;INT # that was trapped
  103. B_ax            dw      ?       ;Regs BEFORE executing INT
  104. B_bx            dw      ?
  105. B_cx            dw      ?
  106. B_dx            dw      ?
  107. B_es            dw      ?
  108. B_ds            dw      ?
  109. B_ss            dw      ?
  110. B_sp            dw      ?
  111. B_si            dw      ?
  112. B_di            dw      ?
  113. B_bp            dw      ?
  114. B_cs            dw      ?       ;CS of invoker of INT
  115. B_ip            dw      ?       ;IP of invoker
  116. BEFORE          ends
  117.  
  118. AFTER           struc           ;AFTER record type
  119. A_type          db      ?       ;see above
  120. A_int           db      ?       ;INT # that was executed
  121. A_ax            dw      ?       ;Regs AFTER executing INT
  122. A_bx            dw      ?
  123. A_cx            dw      ?
  124. A_dx            dw      ?
  125. A_es            dw      ?
  126. A_ds            dw      ?
  127. A_si            dw      ?
  128. A_di            dw      ?
  129. A_bp            dw      ?
  130. A_flags         dw      ?       ;Flags AFTER doing INT
  131. AFTER           ends
  132.  
  133. FCB             struc                   ;INT 21h FCB record
  134. FCB_type        db      ?               ;see above
  135. FCB_int         db      ?               ;INT # that was executed (21h)
  136. FCB_drive       db      ?               ;drive field of FCB
  137. FCB_name        db      "????????"      ;filename field of FCB
  138. FCB_ext         db      "???"           ;extension field of FCB
  139. FCB             ends
  140.  
  141. ASCIIZ          struc                   ;INT 21h ASCIIZ record
  142. AZ_type         db      ?               ;see above
  143. AZ_int          db      ?               ;INT # that was executed (21h)
  144. AZ_str          db      "?????????????????????????????????????????????????????????????????"
  145. ASCIIZ          ends
  146.  
  147.  
  148. ;********************************************************
  149. ;
  150. ; Definition of Interrupt Control Table count
  151. ;
  152. ;********************************************************
  153.  
  154. number_icts     equ     16     ;note: number of ICT's 
  155.                                ;built into executable code
  156.                                ;in trace1.asm
  157.  
  158. ;********************************************************
  159. ;
  160. ; Definition of Interrupt Control Table entries
  161. ;
  162. ;********************************************************
  163.  
  164. ICT             struc
  165. ICT_flags       db      ?       ;See below
  166. ICT_flags2      db      ?       ;See belop
  167. ICT_intnum      db      ?       ;interrupt # this table belongs to
  168. ICT_AH_lo       db      ?       ;lower AH limit to trace
  169. ICT_AH_hi       db      ?       ;upper AH limit to trace
  170. ICT_orig_hndlr  dd      ?       ;cs:ip of original handler
  171. ICT_hits        dw      ?       ;# traces made for this ICT
  172. ICT_num         db      ?       ;ICT number (0-7)
  173. ICT             ends
  174.  
  175. ;
  176. ; Equates for flags byte of ICT
  177. ;
  178.  
  179. F_ACTIVE        equ     10000000b       ;Bit 7 = this ICT is active
  180. F_RET           equ     01000000b       ;Bit 6 = This INT exits via RET
  181. F_RET2          equ     00100000b       ;Bit 5 = This INT exits via RET2
  182. F_IRET          equ     00010000b       ;Bit 4 = This INT exits via IRET
  183. F_ENABLE        equ     00001000b       ;Bit 3 = Tracing enabled for this ICT
  184. F_FCB           equ     00000100b       ;Bit 2 = enable FCB/ASCII traces for INT 21h
  185. F_ROM           equ     00000010b       ;Bit 1 = exclude ROM invocations of this INT
  186. F_BELOW         equ     00000001b       ;Bit 0 = exclude invokers below us (DOS etc)
  187.  
  188. ;
  189. ; Equates for flags2 byte of ICT
  190. ;
  191.  
  192. F_CALL          equ     10000000b       ;Bit 7 = This ICT never returns
  193.  
  194.  
  195. ;
  196. ; Define interrupts to be traced by filling in the following ICT's.
  197. ; Note that there are only 8. That's the max that can be traced.
  198. ; Note that the F_ACTIVE flag must be set in used ICT's, and off in
  199. ; those that aren't defining something that you want traced.
  200. ;
  201. ; Don't mess with the last 3 fields in the ICT!!! Leave 'em as-is.
  202. ;
  203. ;   It is EXTREMELY important that you specify how the interrupt exits.
  204. ;   Set exactly one of the following flag bits:
  205. ;
  206. ;   F_RET   Interrupt exits via simple far RET, leaving original interrupts
  207. ;           on the stack for the caller to pop. INT's 025H and 026H are prime
  208. ;           examples.
  209. ;
  210. ;   F_RET2  Interrupt exits via RET 2, dropping original flags and returning
  211. ;           flags as set by interrupt handler. INT 021H (and anybody else
  212. ;           that uses flags like CARRY or ZERO to reflect results) does this.
  213. ;
  214. ;   F_IRET  Interrupt exits via IRET, restoring original flags from stack.
  215. ;           Hardware interrupt handlers do this, and many ROM BIOS routines.
  216. ;
  217. ;   Note that some interrupts may exit differently, depending on the specific
  218. ;   function requested. You may want to define several ICT's for a given
  219. ;   interrupt, each handling a different AH range.
  220. ;
  221. ;
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.